#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 1010;
int t, s, d;
int g[N][N];
int arr[N];
void floyd(int mi,int ma)
{
	for (int k = mi; k <= ma; k++) {
		for (int i = mi; i <= ma; i++) {
			for (int j = mi; j <= ma; j++) {
				g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
			}
		}
	}
}
int main()
{
	while (scanf_s("%d%d%d", &t, &s, &d)) {
		int mi = 1010;
		int ma = -1010;
		int a, b, c;
		memset(g, 0x3f, sizeof(g));
		memset(arr, 0, sizeof(arr));
		while (t--) {
			scanf_s("%d%d%d", &a, &b, &c);
			g[a][b] = min(g[a][b], c);
			mi = min(mi, a);
			mi = min(mi, b);
			ma = max(ma, a);
			ma = max(ma, b);
		}
		floyd(mi, ma);
		int ans = 0x3f;
		for (int i = 0; i < s; i++) {
			scanf_s("%d", &arr[i]);
		}
		int x;
	    //cout << g[1][8] << endl;
		for (int i = 0; i < d; i++) {
			scanf_s("%d", &x);
			for (int j = 0; j < s; j++) {
				ans = min(ans, g[arr[i]][x]);
			}
		}
		printf("%d\n", ans);
	}
	return 0;
}